package com.sugon.modules.device.consts;

import cn.hutool.core.map.MapUtil;

import java.util.Map;

/**
 * 设备工单来源：一键报修，系统报修，补充录入
 * <p>
 * 工单目前主要指：设备维修工单
 *
 * @Author YuXD
 * @Version 1.0
 * @since 2023/3/13
 */
public enum DeviceTicketSource {

    HMI("一键报修", ""), SYSTEM("系统报修", "通过ERMS正常报修流程进入"), SECOND("补充录入", "");

    String name;

    String desc;

    DeviceTicketSource(String name, String desc) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 获取来源map键值对
     * @return
     */
    public static Map<String, String> getSourseMap() {
        Map<String, String> map = MapUtil.newHashMap();
        DeviceTicketSource[] values = values();
        for (DeviceTicketSource value : values) {
            map.put(value.getName(), value.name());
        }
        return map;
    }
}
